﻿<UserControl x:Class="DrumMachine.UI.WPF.DrumMachineView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:timeSignature1="clr-namespace:DrumMachine.UI.WPF.TimeSignature"
             xmlns:importExport="clr-namespace:DrumMachine.UI.WPF.ImportExport">
  
    <Grid x:Name="MainGrid">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="3*" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="200" />
            <RowDefinition Height="220" />
            <RowDefinition Height="220" />
        </Grid.RowDefinitions>
        <TabControl Grid.Column="0" Grid.Row="0" Grid.RowSpan="2">
            <TabItem Header="Time Signature">
                <timeSignature1:TimeSignatureGrid x:Name="TimeSignaturePanel" />
            </TabItem>
        </TabControl>
        <TabControl Grid.Column="1" Grid.Row="0" Grid.RowSpan="1">
            <TabItem Header="Control Panel">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="150"/>
                        <ColumnDefinition Width="100"/>
                        <ColumnDefinition Width="30"/>
                        <ColumnDefinition Width="30"/>
                        <ColumnDefinition Width="Auto"/>
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="50" />
                        <RowDefinition Height="50" />
                    </Grid.RowDefinitions>
                    
                    <Label Grid.Column="0" Grid.Row="0" FontSize="20" >Measures</Label>
                    <ComboBox Grid.Column="0" Grid.Row="1" x:Name="MeasuresCount" ItemsSource="{Binding AvailableMeasures}" SelectedItem="{Binding Measures}" FontSize="20" />

                    <Label Grid.Column="1" Grid.Row="0" FontSize="20"  Content="{Binding TempoMarker,Mode=TwoWay}"/>
                    <Slider Grid.Column="1" Grid.Row="1" Minimum="{Binding MinimumTempo}" Maximum="{Binding MaximumTempo}" Value="{Binding TempoValue}"/>
                
                    <Label Grid.Column="2" Grid.Row="0" FontSize="20">Note</Label>
                    <ComboBox Grid.Column="2" Grid.Row="1" ItemsSource="{Binding NotesTypes}" SelectedItem="{Binding SelectedNoteType}" />

                    <Label Grid.Column="3" Grid.Row="0" FontSize="20" Grid.ColumnSpan="2">Bars</Label>
                    <Button Grid.Column="3" Grid.Row="1" Command="{Binding AddBarsCommand}" FontSize="30" Content="+"/>
                    <Button Grid.Column="4" Grid.Row="1" Command="{Binding RemoveBarsCommand}" FontSize="30" Content="-"/>


                    <Button Grid.Column="5" Grid.Row="0" Command="{Binding PlayCommand}" FontSize="30" Content="Play"/>
                    <Button Grid.Column="5" Grid.Row="1" Command="{Binding StopCommand}" FontSize="30" Content="Stop"/>
                </Grid>
            </TabItem>
        </TabControl>
        <TabControl Grid.Column="1" Grid.Row="1" Grid.RowSpan="2" >
            <TabItem Header="Pattern">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="40"/>
                        <RowDefinition />
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="80"/>
                        <ColumnDefinition Width="80"/>
                        <ColumnDefinition Width="80"/>
                        <ColumnDefinition />
                    </Grid.ColumnDefinitions>
                    <ToggleButton Name="SplitButton" Grid.Row="0" Grid.Column="0" IsChecked="{Binding IsSplitModeEnabled}" Content="SPLIT" FontSize="20"/>
                    <ToggleButton Name="JoinButton" Grid.Row="0" Grid.Column="1" IsChecked="{Binding IsJoinModeEnabled}" Content="JOIN" FontSize="20"/>
                    <Button Name="ClearButton" Grid.Row="0" Grid.Column="2" Content="Clear" Command="{Binding ClearCommand}" FontSize="20"/>
                
                    <Grid Name="PatternGrid" Grid.Row="1" Grid.ColumnSpan="4" Grid.Column="0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                    </Grid.ColumnDefinitions>
                </Grid>
                </Grid>
            </TabItem>
        </TabControl >
        <TabControl  Grid.Column="0" Grid.Row="2" >
            <TabItem Header="Import/Export">
                <importExport:ImportExport />
            </TabItem>
        </TabControl>
        
    </Grid>
</UserControl>